﻿<%@ Page Language="C#"  AutoEventWireup="true" CodeFile="SelectCustomer.aspx.cs" Inherits="SelectCustomer" Title="Untitled Page" %>
<html>
<head>
    <link href="css/hfmanger.css" rel="stylesheet" type="text/css" />

<script language="javascript" type="text/javascript">

function btnOk_onclick()
 {
 var resultArray=new Array();
 resultArray.length=2;
  var result="";
  if (document.all.gvCustomer==null||document.all.gvCustomer.rows==null)
  {
   alert('请选择客户信息!!');
	   return;
  }
  for( i=1;i<document.all.gvCustomer.rows.length;i++)
  {
     var cb=document.all.gvCustomer.rows(i).cells(0).children(0);
     if(cb.checked)
     {
       result=document.all.gvCustomer.rows(i).cells(0).innerText;
       resultArray[0]=document.all.gvCustomer.rows(i).cells(0).innerText;
       resultArray[1]=document.all.gvCustomer.rows(i).cells(1).innerText;
       
     }
  }
    if (result=="")
	{
	   alert('请选择客户信息!');
	   return;
	}
//	returnValue=result;
    returnValue=resultArray;
	window.close();	
}



function btnClose_onclick() {
window.close();	
}

</script>
<base target="_self">
</head>
<body >
<form id="form1" runat="server">
    <table width="100%">
        <tr>
            <td align="left" class="btn" colspan="3" style="height: 23px" valign="middle">
                <strong class="btn">选择客户信息</strong></td>
        </tr>
        <tr>
            <td align="left" class="toolbar">
                            <asp:RadioButton ID="rbtCode" runat="server" Checked="True" EnableViewState="False"
                                GroupName="1" meta:resourcekey="RadioButton1Resource1" Text="编号" />
                            <asp:RadioButton ID="rbtCaption" runat="server" GroupName="1" meta:resourcekey="RadioButton2Resource1"
                                Text="名称" />
                            <asp:TextBox ID="tbxSearch" runat="server" meta:resourcekey="TextBox5Resource1"></asp:TextBox>
                            <asp:Button ID="btnSearch" runat="server" CssClass="btn" meta:resourcekey="Button1Resource2"
                                OnClick="btnSearch_Click" Text="查询" />
                            <input id="btnOk" class="btn" 
                                style="width: 61px" type="button" value="确定" onclick="btnOk_onclick();" />
                            <input id="btnClose" class="btn"  onclick="btnClose_onclick()"
                                style="width: 61px" type="button" value="关闭" /></td>
        </tr>
        <tr>
            <td align="center" colspan="3">
                <table style="width: 100%">
                    <tr>
                        <td class="listContent">
                            <asp:GridView ID="gvCustomer" runat="server" AutoGenerateColumns="False" CellPadding="4"
                                DataKeyNames="Customer_Code" ForeColor="#333333" GridLines="Horizontal" PageSize="20">
                                <FooterStyle BackColor="Black" Font-Bold="True" ForeColor="Black" />
                                <Columns>
                                    <asp:TemplateField HeaderText="客户编号">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Customer_Code") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:CheckBox ID="CheckBox1" runat="server" Text='<%# Bind("Customer_Code") %>' />
                                        </ItemTemplate>
                                        <ItemStyle Width="100px" />
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="Customer_Caption" HeaderText="客户名称">
                                        <ItemStyle Width="300px" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="CustClassName" HeaderText="类型">
                                        <ItemStyle Width="100px" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Customer_Linker" HeaderText="联系人">
                                        <ItemStyle Width="100px" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Customer_Tel" HeaderText="电话">
                                        <ItemStyle Width="150px" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Customer_Status" HeaderText="状态">
                                        <ItemStyle Width="50px" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Customer_Used" HeaderText="有效">
                                        <ItemStyle Width="50px" />
                                    </asp:BoundField>
                                </Columns>
                                <RowStyle BackColor="#EFF3FB" />
                                <EditRowStyle BackColor="#2461BF" />
                                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                <PagerStyle ForeColor="Black" HorizontalAlign="Center" />
                                <HeaderStyle CssClass="gridHead" Font-Bold="False" ForeColor="Black" HorizontalAlign="Left" />
                                <AlternatingRowStyle BackColor="White" />
                            </asp:GridView>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>